package edu.maping.easy.gui;

import java.util.ArrayList;
import java.util.List;

import processing.core.PApplet;
import processing.core.PFont;

public class ScreenLogger {

	PApplet pApplet;
	PFont font = null;

	List<Text> textos = new ArrayList<Text>();

	public void writeText(String string) {
		Text text = new Text(string, 100);
		textos.add(text);
	}

	public void draw(PApplet pApplet) {
		int y = 100;
		for (int index = 0; index < textos.size(); index++) {
			Text text = textos.get(index);
			if (text.time < 1) {

			} else {
				pApplet.fill(255, 255, 153, text.time * 2);
				pApplet.text(text.cad, 250, y, pApplet.width - 200, 20);
				text.time--;
				y += 25;
			}
		}
	}

	public void setup(PApplet pApplet) {
		this.pApplet = pApplet;
		font = pApplet.loadFont("Ziggurat-HTF-Black-32.vlw");
		pApplet.textFont(font, 24);
	}
}
